import pytest
from apiCore.ApiService import ApiService


@pytest.fixture(scope="session")
def set_api_service(request):
    api_service = ApiService()

    # 添加会话结束时的清理工作
    def fin():
        # 执行任何必要的清理
        api_service.requestCore.session.close()

    request.addfinalizer(fin)
    yield api_service
